#ifndef ENV_H
#define ENV_H


#include <stdio.h>
#include "types.h"
#include "symbol.h"
#include "irr/temp.h"
#include "irr/tree.h"
#include "irr/frame.h"
#include "irr/translate.h"

typedef struct E_enventry_ *E_enventry;
struct E_enventry_{
  enum {E_varEntry, E_funEntry} kind;
  union { struct {Tr_access access; Ty_ty ty;} var;
          struct {Tr_level level; Ty_tyList formals; Ty_ty result; } fun;
  } u;
};

E_enventry E_VarEntry(Tr_access access, Ty_ty ty);
E_enventry E_FunEntry(Tr_level level, Ty_tyList formals, Ty_ty result);

S_table E_base_tenv(void);
S_table E_base_venv(void);

#endif